package com.spring.boot.springBoot.controller;

/**
 * Created by pactera on 2017/9/28.
 */

import com.spring.boot.springBoot.service.UserDemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

@Controller
public class TemplateController {


    @Autowired
    private UserDemoService userDemoService;
    /**
     * 返回html模板.
     */
    @RequestMapping("/helloHtml")
    public String helloHtml(Model model){
        model.addAttribute("user",userDemoService.getById(1));
            return"/userDemo";
    }



}
